﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace 门诊医生工作站
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            string strConn = "Server=DESKTOP-TN5FD7G; DataBase = DocWorkStationBsae; Integrated Security = sspi";
            SqlConnection conn = new SqlConnection(strConn);
            DataSet dataSet = new DataSet();
            string sql = $"SELECT * FROM dbo.tb_Office";
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sql, conn);
            sqlDataAdapter.Fill(dataSet, "dbo.tb_Office");
            DataRow dataRow = dataSet.Tables["dbo.tb_Office"].NewRow();
            dataRow[0] = -1;
            dataRow[1] = "--请选择--";
            dataSet.Tables["dbo.tb_Office"].Rows.InsertAt(dataRow, 0);
            this.comboBox1.DataSource = dataSet.Tables["dbo.tb_Office"];
            this.comboBox1.ValueMember = "No";
            this.comboBox1.DisplayMember = "Name";
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
        }
    }
}
